Ejemplo de r markdown haciendo una grafica sencilla con ggplot y luego usando ggplotly para que se vea interactiva.
kable(summary(cars))%>%
kable_styling(bootstrap_options = c("striped", "hover"))
|
| |
|---|---|---|
| Min. : 4.0 | Min. : 2.00 | |
| 1st Qu.:12.0 | 1st Qu.: 26.00 | |
| Median :15.0 | Median : 36.00 | |
| Mean :15.4 | Mean : 42.98 | |
| 3rd Qu.:19.0 | 3rd Qu.: 56.00 | |
| Max. :25.0 | Max. :120.00 |
# Scatterplot
p<-ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species, shape=Species)) +
geom_point(size=6, alpha=0.6)
ggplotly(p)